package com.ibp.controller;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ibp.entity.AppMgr;
import com.ibp.entity.ClusterConfMgr;
import com.ibp.response.DataResponse;
import com.ibp.response.FormResponse;
import com.ibp.response.SimpleResponse;
import com.ibp.service.AppMgrService;
import com.ibp.service.ClusterConfMgrService;

@Controller
@RequestMapping("clusterConfMgr")
public class ClusterConfMgrController extends BasicController {

	private static Logger logger = LoggerFactory
			.getLogger(ClusterConfMgrController.class);

	@Autowired
	ClusterConfMgrService clusterConfMgrSerivceImpl;


	/***
	 * 进入集群配置管理页面
	 * 
	 * @return
	 */
	@RequestMapping("/clusterConfMgrDetails")
	public String toclusterConfMgrDetails() {
		logger.info("进入集群配置管理页面cluster_conf_mgr_details.jsp");
		return "ibp/cluster_conf_mgr_details";
	}
	
	/***
	 * 进入服务节点配置管理页面
	 * 
	 * @return
	 */
	@RequestMapping("/nodesMgr")
	public String toNodeList() {
		logger.info("进入服务节点配置管理页面nodes_mgr.jsp");
		return "ibp/nodes_mgr";
	}


	/***
	 * 进入交易码页面
	 * 
	 * @return
	 */
	@RequestMapping("/appsMgr")
	public String toRegistryList() {
		logger.info("进入交易码信息页面apps_mgr.jsp");
		return "ibp/apps_mgr";
	}

	/***
	 * 进入服务节点页面
	 * 
	 * @return
	 */
	@RequestMapping("/projectsMgr")
	public String toServiceNodeList() {
		logger.info("进入进入服务节点页面页面projects_mgr.jsp");
		return "ibp/projects_mgr";
	}


	/***
	 * 查询集群管理明细信息
	 * 
	 * @return
	 */
	@RequestMapping("/getClusterConfDetails")
	@ResponseBody
	public DataResponse<ClusterConfMgr> getClusterConfDetails(ClusterConfMgr ccm) {
		logger.info("查询集群管理明细信息：" + ccm.toString());
		DataResponse<ClusterConfMgr> response = new DataResponse<ClusterConfMgr>();
		response.setData(clusterConfMgrSerivceImpl
				.getClusterConfMgr());
		return response;
	}



}
